C语言 #include "string.h" 的 意思

来源:百度知道 编辑:UC知道 时间:2024/05/21 09:32:30
#include "string.h" 起什么作用

#include"string.h"表示包含字符串处理函数的头文件,是C语言中的预处理命令。经该预处理后,可调用字符串处理函数,例如strlen()函数(求字符串长度函数)、strcat()函数(字符串拼接函数)、strcmp()函数(字符串比较函数)等等。

#include“string.h”是在程序编译之前要处理的内容,与字符串的调用有关

包括常用函数如下:

strlen求字符串长度

strcmp比较2个字符串是否一样

strcat字符串连接操作

strcpy字符串拷贝操作

strncat字符串连接操作(前n个字符)

strncpy字符串拷贝操作(前n个字符)

strchr查询字串

strstr 查询子串

举例说明:

例如strcat()字符串链接函数;strcpy()字符串复制函数等等。

以strcpy函数为例实现它的调用:

#include <stdio.h>

#include"string.h" 

int main()

{

char a[50]="asd",b[10]="aaa";

strcpy(a,b);

printf("%s\n",a);

}

C语言 #include "string.h" 的 意思 c语言中#include "stdio.h"是什么? C语言中include是什么 关于C语言中的 include! C语言的 #include 问题 在C语言中#include "stdio.h"和#include <stdio.h>有什么区别? 大家谁用的是windows2000及可以用C语言帮个忙:#include " " #include <> c语言中头文件#include <stdio.h>和#include "stdio.h"有什么区别? #include "iostream.h"这个是c语言里的什么头文件啊? 在C语言宏定义中#include <maths.h>和include "maths.h"有什么不同?(除了形式上<>和" "之外)